package com.cq.hd.member.api;

import com.cq.hd.common.response.Result;
import com.cq.hd.member.api.dto.ConfigSettingQueryDto;
import com.cq.hd.member.api.dto.ConfigSettingUpdateDto;
import com.cq.hd.member.api.vo.ConfigSettingVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "hd-o2o-member-service", contextId = "config-setting-api")
public interface TbConfigSettingApi {

    @PostMapping("/member/configSetting/setConfigValue")
    Result<Void> setConfigValue(@RequestBody ConfigSettingUpdateDto configSettingUpdateDto);

    @PostMapping("/member/configSetting/list")
    Result<List<ConfigSettingVo>> list(@RequestBody ConfigSettingQueryDto configSettingQueryDto);

    @GetMapping("/member/configSetting/getUserConfigValue")
    Result<String> getUserConfigValue(@RequestParam("userId") Long userId, @RequestParam("configKey") String configKey);

}
